// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 新增目录 新增目录 POST /catalogue/addCatalogue */
export async function addCatalogueUsingPost(
  body: dataFactory.AddCatalogueDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/catalogue/addCatalogue', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除目录 通过ID删除目录 DELETE /catalogue/deleteCatalogue/${param0} */
export async function deleteCatalogueUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: dataFactory.deleteCatalogueUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<dataFactory.R>(`/catalogue/deleteCatalogue/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取目录 通过ID获取目录 GET /catalogue/getCatalogue/${param0} */
export async function getCatalogueUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: dataFactory.getCatalogueUsingGETParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<dataFactory.R>(`/catalogue/getCatalogue/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取目录列表 获取所有目录 GET /catalogue/listCatalogues */
export async function listCataloguesUsingGet(options?: { [key: string]: any }) {
  return request<dataFactory.R>('/catalogue/listCatalogues', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 更新目录 更新已有目录 PUT /catalogue/updateCatalogue */
export async function updateCatalogueUsingPut(
  body: dataFactory.UpdateCatalogueDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/catalogue/updateCatalogue', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
